import http from '@/utils/request/http'

// 获取osstoken
const getOssToken = () => {
    return http.get('/v1/oss/getStsToken', null, { successTip: false })
}

//#region 文件夹
const selectFolder = (params) => {
    return http.get('/v1/posFolder/select', params, { successTip: false })
}
// 创建
const createFolder = (params: any) => {
    return http.post('/v1/posFolder/create', params)
}
// 编辑
const editFolder = (params: any) => {
    return http.put('/v1/posFolder/edit', params)
}
// 删除
const delFolder = (id: number | string) => {
    return http.del('/v1/posFolder/del', { id })
}
//#endregion

//#region 
// 图片入库
const createPhoto = (params: any) => {
    return http.post('/v1/posPhoto/create', params)
}
// 图片分页列表
const photoPage = (params: any) => {
    return http.get('/v1/posPhoto/page', params, { successTip: false })
}
//#endregion

export default {
    getOssToken,
    selectFolder,
    createFolder,
    editFolder,
    delFolder,
    createPhoto,
    photoPage
}